<%--
  Created by IntelliJ IDEA.
  User: jun
  Date: 2017/7/19
  Time: 下午8:15
--%>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<html>
<head>
    <title>主页</title>
    <style>
        body {
            background-color: #1f2222;
        }

        .main-wrap {
            width: 80%;
            height: 50%;
            margin: 60px auto;
        }

        .main-title {
            color: #fafafa;
            text-align: center;
            font-size: 40px;
        }

        .logout-title {
            color: #33a3dc;
            font-size: 40px;
            text-decoration: none;
            cursor: pointer;
        }

        .logout-title:hover {
            color: white;
            transition: all .6s;
        }

    </style>
</head>
<body>
<div class="main-wrap">
    <div class="main-title">登陆成功</div>
    <div class="main-title">${userName}</div>
    <div class="main-title">${userIp}</div>
    <div class="main-title">${sessionId}</div>
    <div class="main-title"><span><a href="/manage" class="logout-title">后台管理</a></span></div>
    <div class="main-title"><span class="logout-title j_logout">注销</span></div>
</div>
<script src="/js/common/google-analytics.js"></script>
<script src="/js/common/jquery.1.11.3.min.js"></script>
<script src="/js/common/jweixin-1.2.1.js"></script>
<script src="/js/home/index.js"></script>
<script type="text/javascript">
    var ELData = {
        userName: '${userName}',
        userIp: '${userIp}',
        sessionId: '${sessionId}',
    };
    var GData = {};
    var GFunc = {
        bind: function () {
            $('.j_logout').click(function () {
                $.post('/logout.do', function (data) {
                    if (data.code == 200 || data.code == 401) {
                        window.location.href = '/';
                    } else {
                        alert(data.message);
                    }
                })
            });
        },
    };
    $(function () {
        GFunc.bind();
    });
</script>
</body>
</html>
